// vite.config.js
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [uni()],
  server: {
    port: 5173,
    https: true,
    cors: true,

    proxy: {
      '/devServer': {
        target: 'https://test-suan.huilingx.com',
        changeOrigin: true,
        secure: false,
        ws: false,
        logLevel: 'debug',
        rewrite: (path: string) => path.replace(/\/devServer/, ''),
      },
      '/releaseServer': {
        target: 'https://suan.huilingx.com',
        changeOrigin: true,
        secure: false,
        ws: false,
        logLevel: 'debug',
        rewrite: (path: string) => path.replace(/\/releaseServer/, ''),
      },
    },
  },
})
